<template>
  <div>
    <el-container style="height: 696px; border: 1px solid #eee">
      <Left></Left>
      <el-container>
        <el-header style="text-align: right; font-size: 12px;width: 100%;">
          <Top></Top>
        </el-header>
        <el-main>
          <el-row>
            <el-col :span="24">
              <div class="grid-content bg-purple-dark">
                <b style="font-family: '微软雅黑';color: #606266;margin: 20px 30px;text-align: center;font-size: 20px;">所有学生列表信息</b>
              </div>
            </el-col>
          </el-row>
          <div style="margin: 50px auto;width: 90%;box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);">
            <el-table
              :data="tableData"
              border
              style="width: 100%">
              <el-table-column
                label="ID"
                prop="id">
              </el-table-column>
              <el-table-column
                label="学生 ID"
                prop="studentId">
              </el-table-column>
              <el-table-column
                label="学生学号"
                prop="studentNum">
              </el-table-column>
              <el-table-column
                label="学生姓名"
                prop="studentName">
              </el-table-column>
              <el-table-column
                label="教学生密码"
                prop="studentPassword">
              </el-table-column>
              <el-table-column
                label="学生权限"
                prop="studentShiro">
              </el-table-column>
            </el-table>
          </div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import Left from '@/components/adminSide/left'
import Top from '@/components/adminSide/top'

export default {
  name: 'studentPersonnel',
  data () {
    return {
      tableData: [{
        id: '',
        studentId: '',
        studentName: '',
        studentNum: '',
        studentPassword: '',
        studentShiro: ''
      }]
    }
  },
  created () {
    this.getAllStudent()
  },
  methods: {
    // 管理员获取所有学生信息
    getAllStudent () {
      this.$axios.get('http://localhost:8888/adminGetAllStudent').then(res => {
        console.log(res)
        if (res.data.flag) {
          this.$message({
            message: '恭喜你，所有学生信息获取成功',
            type: 'success'
          })
          this.tableData = res.data.data
        }
      }).catch(err => {
        return Promise.reject(err)
      })
    }
  },
  components: {
    Left,
    Top
  }
}
</script>

<style>
  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }

  .el-aside {
    color: #333;
  }
</style>
<style scoped>
  .router-link-active {
    text-decoration: none;
    color: yellow;
  }

  a {
    text-decoration: none;
    color: white;
  }

  .el-chart-a {
    width: 1200px;
    height: 500px;
    margin: 10px auto;
  }

  .el-chart-1 {
    width: 400px;
    height: 400px;
    border-radius: 4px;
    list-style-type: none;
    margin-left: 40px;
    margin-right: 50px;
  }

  .el-chart-2 {
    width: 400px;
    height: 400px;
    border-radius: 4px;
    list-style-type: none;
  }

  .el-chart-b {
    width: 1200px;
    height: 500px;
    margin: 20px auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .30);
  }

  li {
    float: left;
  }

  .el-chart {
    width: 100%;
    height: 250px;
  }

  .el-chart ul li {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .30);
    width: 220px;
    height: 120px;
    /*border: 1px solid gold;*/
    list-style-type: none;
    margin-right: 50px;
  }

  .el-chart ul li:hover {
    background-color: #eee;
  }
</style>
<style>
  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }

  .el-aside {
    color: #333;
  }
</style>
<style scoped>
  .router-link-active {
    text-decoration: none;
    color: yellow;
  }

  a {
    text-decoration: none;
    color: white;
  }

  .el-chart-a {
    width: 1200px;
    height: 500px;
    margin: 10px auto;
  }

  .el-chart-1 {
    width: 400px;
    height: 400px;
    border-radius: 4px;
    list-style-type: none;
    margin-left: 40px;
    margin-right: 50px;
  }

  .el-chart-2 {
    width: 400px;
    height: 400px;
    border-radius: 4px;
    list-style-type: none;
  }

  .el-chart-b {
    width: 1200px;
    height: 500px;
    margin: 20px auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .30);
  }

  li {
    float: left;
  }

  .el-chart {
    width: 100%;
    height: 250px;
  }

  .el-chart ul li {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .30);
    width: 220px;
    height: 120px;
    /*border: 1px solid gold;*/
    list-style-type: none;
    margin-right: 50px;
  }

  .el-chart ul li:hover {
    background-color: #eee;
  }
</style>
<style>
  .demo-table-expand {
    font-size: 0;
  }
  .demo-table-expand label {
    width: 90px;
    color: #99a9bf;
  }
  .demo-table-expand .el-form-item {
    margin-right: 0;
    margin-bottom: 0;
    width: 50%;
  }
</style>
<style>
  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }

  .el-aside {
    color: #333;
  }
</style>
<style scoped>
  .router-link-active {
    text-decoration: none;
    color: yellow;
  }
  a{
    text-decoration: none;
    color: white;
  }
</style>
<style>
  .el-row {
    margin-bottom: 20px;
  &:last-child {
     margin-bottom: 0;
   }
  }
  .el-col {
    border-radius: 4px;
  }
  .bg-purple-dark {
    background: #cadcf5;
  }
  .bg-purple {
    background: #d3dce6;
  }
  .bg-purple-light {
    background: #e5e9f2;
  }
  .grid-content {
    border-radius: 4px;
    min-height: 36px;
  }
  .row-bg {
    padding: 10px 0;
    background-color: #f9fafc;
  }
</style>
